#ifndef __TreeNode_H
#define __TreeNode_H

#include "BTree.h"
#include <string>
using namespace std;
typedef int TreeKey;

class TreeItem;

class TreeNode
{
	TreeItem *mData;
	int minM,minR ; 
	TreeNode *Right,*Left,*Mid,*Parent;
	int TotalMin; 
	int NumOfChildren;

public: 
	
	TreeNode();
	TreeNode(int key,string data);
	
	/*================== set functions ====================*/
	void SetMinM(int k) {minM=k;}   
	void SetMinR(int k) {minR=k;} 
	void SetRight(TreeNode *rnode){Right=rnode;} 
	void SetLeft(TreeNode *lnode){Left=lnode;}
	void SetMid(TreeNode *mnode) {Mid=mnode; }
	void setMinHolder (int key) {TotalMin=key;}
	void setNumOfChildren (int num) {NumOfChildren=num;}
	void SetData(TreeItem *item);
	void setParent (TreeNode *p) {Parent=p;}
	/*=====================================================*/
	
	/*=================== get functions ====================*/
	TreeItem *GetData() {return mData ;}
	int getMinHolder () {return TotalMin;}
	int GetMinM() {return minM;}
	int GetMinR() {return minR;}
	TreeNode *getParent () {return Parent; }
	TreeNode* GetRight() { return(Right); } 
	TreeNode* GetLeft()	 { return(Left); } 
	TreeNode* GetMid()	 { return(Mid); } 
	int getNumOfChildren () {return (NumOfChildren) ; }
	/*=====================================================*/

	void Print();
	bool isLeaf();
	void SaveInFile(ofstream &out_file);
	void Delete();
};




#endif
